package 多线程.线程状态.TIMED_WAITING;

public class Main {

    public static void main(String[] args) throws InterruptedException {

        Thread t = new Thread(()->{
            int i = 0;
            while(true){
                System.out.println(i++);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();
        t.join(2000*20);
    }
}
